package com.mapproject.industrymap.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mapproject.industrymap.entity.Test02;
import com.mapproject.industrymap.mapper.Test02Mapper;
import com.mapproject.industrymap.utils.ReturnValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/postgresdata")
public class PostgresCRUDController {
    @Autowired
    Test02Mapper testMapper;
    @RequestMapping(value = "/delete")
    public ReturnValue deletedata(@RequestParam(value = "gid")int gid){
        Test02 testdata=new Test02();
        testdata.setGid(gid);
        QueryWrapper<Test02> wrapper = new QueryWrapper<>(testdata);

        int result = this.testMapper.delete(wrapper);
    return new ReturnValue(200,"删除数据条数："+result) ;
    }
}
